import requests

class Remote(requests):

    baseUri = 'https://j1.pupuapi.com/client/'

    headers = {'content-type': 'application/json;charset=UTF-8',
                   'sign': 'c8036e419c856168a4a8ae901c87b855',
                   'pp_storeid': 'a3f5582f-7c6f-4c42-8736-72c8f9620656',
                   'timestamp': '1632649405688',
                   'pp-os': '20',
                   'pp-version': '2021042003',
                   'Accept-Language': 'zh-Hans-CN;q=1.0',
                   'User-Agent': 'Pupumall/2.7.0;iOS 14.8;188AA86D-3DBE-4E30-8E91-2D77FCB62F93',
                   'Accept-Encoding': 'gzip;q=1.0, compress;q=0.5',
                   'mark-num': '30',
                   'Connection': 'keep-alive',
                   'Cookie': 'JSESSIONID=D8F4E1930D09D858F665719BC76EF7F1',
                   }
    api = ''

    params = {}

    apiResponse = None

    def __init__(self) -> None:
        pass

    def getUrl(self):
        return self.baseUri + self.api
    def resolve(self):
        if (self.apiResponse):
            return self.apiResponse.json()
        return None

    def get(self):
        url = self.getUrl()
        self.apiResponse = requests.get(url=url, params=self.params, headers=self.headers);
        
    '''todo post 方法封装'''
    def post(self):
        # url = self.getUrl()
        # self.apiResponse = requests.post();
        pass
    

